<template>
    <vechart :id="id"  :option="chartoption"></vechart>
</template>

<script>
    import vechart from './vechart.vue'

    export default {
        components: {vechart},
        props: ["id", "chartData"],
        data() {
            return {
                chartoption: {
                    tooltip : {
                        trigger: 'axis',

                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',
                            boundaryGap : false,
                            data : this.chartData.xAxis
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value'
                        }
                    ],
                    series : [
                        {
                            name:this.chartData.name,
                            type:'line',
                            data:this.chartData.data
                        },
                    ]
                }
            }
        },
        mounted() {
        }
    };
</script>
